#ifndef SERVER_H
#define SERVER_H

#include <QThread>
#include <QtNetwork>
#include <QList>
#include "client.h"


class server : public QThread
{
    Q_OBJECT
private:
public:
    QString ServerName;
    int ServerPort;
    int ServerInfoPort;
    // Network Part
    QTcpServer* tcpServer;
    QTcpSocket* tcpSocket;

    QList<Client*> client;
    // Level
    QString ServerLevel;
    QString ServerLevelName;

public:
    server(QObject *parent);
    void run();
    void ReadClients();
    bool Get(QString &string, QString &source, QString NodeName);


signals:
    void newConnection();
    void clientsUpdated();
public slots:
    bool startServer();
    bool Connect();
    bool Disconnect(int listItem);
    void DeleteClient();
};

#endif // SERVER_H
